home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / CD CHIP.ISO / WebServ / server7 / bin / ISAPISkeleton.dpr < prev    next >
Encoding:
Text File  |  1996-06-22  |  1.6 KB  |  50 lines

  1. library ISAPISkeleton;
  2.  
  3. { Important note about DLL memory management: ShareMem must be the
  4.   first unit in your library's USES clause AND your project's (select
  5.   View-Project Source) USES clause if your DLL exports any procedures or
  6.   functions that pass strings as parameters or function results. This
  7.   applies to all strings passed to and from your DLL--even those that
  8.   are nested in records and classes. ShareMem is the interface unit to
  9.   the DELPHIMM.DLL shared memory manager, which must be deployed along
  10.   with your DLL. To avoid using DELPHIMM.DLL, pass string information
  11.   using PChar or ShortString parameters. }
  12.  
  13. uses
  14.   SysUtils,
  15.   Classes,
  16.   Httpext;
  17.  
  18. // CASE MATTERS FOR THIS FUNCTION NAME
  19. function GetExtensionVersion(var ver: THSE_VERSION_INFO): Boolean; stdcall;
  20. begin
  21.   result:=True;
  22. end;
  23.  
  24. // CASE MATTERS FOR THIS FUNCTION NAME
  25. function HttpExtensionProc(var ecb: TEXTENSION_CONTROL_BLOCK): LongInt; stdcall;
  26. var
  27.   FN_Write: TWriteClientProc;
  28.   s: String;
  29.   len: Integer;
  30. begin
  31.   // Get the callback function
  32.   @FN_Write:=@ecb.WriteClient;
  33.  
  34.   s:='HTTP/1.0 200 OK'+#13#10#13#10+'<html><head><title>ISAPI Generated Page</title><body><h1>This page was generated by ISAPISkeleton.DLL</h1><hr><h3>'+FormatDateTime('ddd, dd mmm yyyy hh:nn:ss "GMT"', Now)+'</h3></body></head></html>';
  35.   len:=Length(s);
  36.  
  37.   // Write to the socket
  38.   FN_WRITE(ecb.ConnID, PChar(s), len, 0)
  39. end;
  40.  
  41. // * REQUIRED FOR DYNAMIC BINDING.
  42. // * Index values aren't need.
  43. // * Case doesn't matter here.
  44. exports
  45.   GetExtensionVersion,
  46.   HttpExtensionProc;
  47.   
  48. begin
  49. end.
  50.